<style media="screen">
.head-container{
  padding: 10px 0 14px;
  margin-bottom: 15px;
  border-bottom: 1px solid #E3E3E5;
}
.head-container .mes{
  margin-right: 10px;
  float: left;
}
.head-container .mes p{
  font-size: 12px;
  color:#CFCFCF;
  margin-bottom: 6px;
}
.head-container .mes input{
  width: 220px;
  height: 34px;
}
.head-container .flow{
  float: left;
  margin-right: 10px;
}
.head-container .flow p{
  font-size: 12px;
  color:#CFCFCF;
  margin-bottom: 6px;
}
.head-container .flow .flow-select{
  width: 140px;
  height: 34px;
}
.head-container .button-group{
  padding-top: 23px;
  margin-right: 10px;
  float: left;
}
.price-result-wrap .price-content:last-child{
  border-bottom: none;
}
</style>

<section id="price_edit" class="pl-24 pr-24">

  <div class="hl-list-title">
    <h4>新增底价</h4>
  </div>

  <div class="head-container clearfix">
    <div class="flow">
      <p>项目</p>
			<hl-select :data="project" v-model="projectId" width="200" @on-change="getBuildingData"></hl-select>
    </div>

    <div class="flow">
      <p>楼栋</p>
			<hl-select :data="building" v-model="buildId" width="200" @on-change="getbuildId"></hl-select>
    </div>

    <div class="flow">
      <p>单元类型</p>
			<hl-select :data="unitType" v-model="tyAct" width="140" @on-change="getType"></hl-select>
    </div>

    <div class="button-group">
      <hl-button @on-click="getBuList" size="mini">查询</hl-button>
      <hl-button @on-click="resetButton" size="mini">重置</hl-button>
    </div>

    <div class="button-group" style="marginTop:7px;">
      <a href="javascript:;" @click="batchSet('0')" v-if="!batchType">批量设置</a>
      <a href="javascript:;" @click="batchSet('1')" v-if="batchType">取消批量</a>
    </div>
  </div>

  <div class="list br-4 mb-10" style="border:1px solid #E5E5E5;" v-if="tyAct[0]">
    <ul class="dy-flex l-h-40 text-center global_table_title">
      <li class="dy-fx-1">序</li>
      <li class="dy-fx-3">楼层</li>
      <li class="dy-fx-2">单元名称</li>
      <li class="dy-fx-2" v-if="tyAct[0] == 'WP'">工位名称</li>
      <li class="dy-fx-2" v-if="tyAct[0] == 'BU'">业态</li>
      <li class="dy-fx-2" v-if="tyAct[0] == 'BU'">面积(m²)</li>
      <li class="dy-fx-3" v-if="tyAct[0] == 'BU'">底价</li>
      <li class="dy-fx-3" v-if="tyAct[0] == 'WP'">底价</li>
      <li class="dy-fx-2">操作</li>
    </ul>
    <!-- 111111 -->
    <ul class="dy-flex l-h-40 text-center border-t global_table_item" v-for="(item, index) in BuList">
      <li class="dy-fx-1">{{index < 9 ? '0'+(index+1) : (index+1)}}</li>
      <li class="dy-fx-3" v-if="tyAct[0] == 'BU'">{{item.floorName}}</li>
      <li class="dy-fx-3" v-if="tyAct[0] == 'WP'">{{item.floorName}}</li>
      <li class="dy-fx-2" >{{item.unitName}}</li>
      <li class="dy-fx-2" v-if="tyAct[0] == 'WP'">{{item.positionName}}</li>
      <li class="dy-fx-2" v-if="tyAct[0] == 'BU'">{{item.businessType | formatBusinessType}}</li>
      <li class="dy-fx-2" v-if="tyAct[0] == 'BU'">{{item.acreage}}</li>
      <li class="dy-fx-3 clearfix relative">
        <div v-if="!item.flag" style="text-align:right; padding-right:12px;">
          {{item.basePrice || '--'}}
          <span v-if="tyAct[0] == 'BU'">{{item.basePriceType ? (item.basePriceType == 'M' ? '(元/m²/月)' : '(元/m²/天)') : '(元/m²/天)'}}</span>
          <span v-if="tyAct[0] == 'WP'">{{item.basePriceType ? (item.basePriceType == 'M' ? '(元/个/月)' : '(元/个/天)') : '(元/个/天)'}}</span>
        </div>
        <input type="text" v-model="item.basePrice" v-if="item.flag" class="form-control text-left inline" style="width: 100%;" @blur="valdataNumber(item.basePrice, index)">
        <div class="select-list absolute font-14 br-4 border-l" v-if="item.flag" style="width:50%; background:#fff; height:30px; line-height:30px; right:4px; top:5px;" @click="flagSelect(index)">
          <div v-if="tyAct[0] == 'BU'">{{item.basePriceType ? (item.basePriceType == 'M' ? '(元/m²/月)' : '(元/m²/天)') : '(元/m²/天)'}}<span class="icon-Gm-prefix-open ml-5"></span></div>
          <div v-if="tyAct[0] == 'WP'">{{item.basePriceType ? (item.basePriceType == 'M' ? '(元/个/月)' : '(元/个/天)') : '(元/个/天)'}}<span class="icon-Gm-prefix-open ml-5"></span></div>
          <ul class="absolute text-center" v-if="item.selected" style="left:0; top:34px; width:100%; background:#fff; box-shadow: 0 0 4px rgba(214,214,214,.75); z-index:100">
            <li v-if="tyAct[0] == 'BU'" v-for="item1 in buType" @click="dmType(index,item1.code)">{{item1.memo}}</li>
            <li v-if="tyAct[0] == 'WP'" v-for="item2 in wpType" @click="dmType(index,item2.code)">{{item2.memo}}</li>
          </ul>
        </div>
      </li>
      <li class="dy-fx-2">
        <a href="javascript:;" v-if="!item.flag" @click="setCel(index, '1')">设置</a>
        <span v-if="item.flag && !batchType">
          <a href="javascript:;" v-if="tyAct[0] == 'BU'" @click="setPrice(item.unitId, item.basePrice, index, item.basePriceType)">确定</a>
          <a href="javascript:;" v-if="tyAct[0] == 'WP'" @click="setPrice(item.positionId, item.basePrice, index,item.basePriceType)">确定</a>
          <a href="javascript:;" @click="setCel(index, '0')">取消</a>
        </span>
        <a href="javascript:;" class="icon-Gm-downcopy font-16" v-if="batchType" @click="downVal(index)"></a>
      </li>
    </ul>
  </div>

  <div class="ml-24 mt-15" v-if="batchType">
    <button type="button" class="btn n-btn-primary" @click="buttonSubmit">保存</button>
  </div>
</section>

<script src="modules/price/scripts/price_edit.js" charset="utf-8"></script>
